<%@page import="java.util.List"%>
<%@page import="edu.ar.modulo3.model.AppConstants"%>
<%@page import="edu.ar.modulo3.model.Empleado"%>
<%@page language="java" contentType="text/html; charset=US-ASCII" pageEncoding="US-ASCII"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<c:set var="vuelos" value="<%= request.getAttribute(AppConstants.VUELO_LIST) %>" target="List"/>
<c:set var="empleado" value="${USERSESSION.persona}" target="Empleado"/>

<html>
	<head>	
		<title>PepesTravels S.A.</title>	
	</head>	
	
	<body>
		
		<div align="center">
			<div style="text-align: left;" > <H2> Bienvenido Sr/Sra: ${empleado.denominacion} </H2> </div>
			<div style="text-align: right;" > <a href="LogOutServlet">logout</a> </div>
		</div>
				
		<div align="center">
			<table width="80%" border="1">
				<thead>
					<tr>
						<th>Destino</th>
						<th>Costo</th>
						<th>Fecha</th>
						<th>Vacante</th>
						<th>Modificar</th>
						<th>Baja</th>
						<th>Detalle</th>						
					</tr>
				</thead>
				
				<tbody>
					<c:forEach var="vueloItem" items="${vuelos}" >
						<tr>
							<td> ${vueloItem.destino} </td>
							<td> ${vueloItem.costo} </td>
							<td> ${vueloItem.fechaVuelo} </td>
							<td>
								<c:if test="${vueloItem.vacante}">
									<span style="color: green;">Si</span>
								</c:if>
								<c:if test="${not vueloItem.vacante}">
									<span style="color: red;">No</span>
								</c:if>	 
							</td>
							<td> 
							 	<a href="">
							 		<img src="images/icono_editar.gif" width="30" height="30"/>
							 	</a>	 
							</td>
							<td> 
								<a href="">
									<img src="images/icono_eliminar.gif" width="30" height="30"/> 
								</a>
							</td>
								
							<td> 
								<a href="">
									<img src="images/icono_buscar.png" width="30" height="30"/>
								</a>	 
							</td>							
						</tr>
					</c:forEach>	
				</tbody>
			
			</table>
			
		
		</div>	
	
	</body>
</html>